package cn.mr;
import org.apache.hadoop.io.Text;
import org.apache.hadoop.mapreduce.Partitioner;
public class NewsPartitioner extends Partitioner<Text,NewsBean> {
    @Override
    public int getPartition(Text key, NewsBean newsBean, int i) {
        if(key.toString().startsWith("民")){
            return 0;
        }
        else if(key.toString().startsWith("财")){
            return 1;
        }
        else if(key.toString().startsWith("体")){
            return 2;
        }
        else if(key.toString().startsWith("文")){
            return 3;
        }
        else{
            return 4;
        }
    }
}

